﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bublesort
{
    class Program
    {
        static void Main(string[] args)
        {

            int[] arr = new int[] { 1,3,5,2,4,6};
            for (int i = 0; i < arr.Length-1; i++)
            {
           
                for (int j =0 ; j < arr.Length-1-i; j++)
                {
                    if(arr[j] > arr[j+1])
                    {
                        int temp = arr[j+1];
                        arr[j+1] = arr[j];
                        arr[j] = temp;
                    }
                    
                }
            }
            foreach (var item in arr)
            {
                Console.Write(item);
            }
            Console.ReadKey();
        }
    }
}
